import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class Forum with ChangeNotifier {
  List<Widget> itemCardList = new List();
  getPost(data) {
    for (var i = 0; i < data['data']['lists'].length - 1; i++) {
      itemCardList.add(PostItem(data['data']['lists'][i]));
    }
    return ListView(
      physics: NeverScrollableScrollPhysics(),
      shrinkWrap: true,
      children: itemCardList,
    );
  }
}

class PostItem extends StatefulWidget {
  var item;
  PostItem(this.item);
  @override
  _PostItemState createState() => _PostItemState(item);
}

class _PostItemState extends State<PostItem> {
  var item;
  _PostItemState(this.item);
  @override
  Widget build(BuildContext context) {
    print(item['update_time'] != '');
    return Container(
      child: Column(
        children: [
          InkWell(
            child: Column(
              children: [
                ClipOval(
                  child: Image.network(
                    'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg',
                    fit: BoxFit.fill,
                    width: 125.w,
                    height: 125.w,
                  ),
                ),
                Text("标题标题标题"),
                Text("内容内容内容内容内容内容"),
              ],
            ),
          )
        ],
      ),
    );
  }
}
